import { request } from '../request'
import type {
    PointsRecord,
    PageRequest,
    PageResponse
} from '@/types'

// 用户签到
export const signIn = (userId: number): Promise<boolean> => {
    return request.post('/api/points-service/api/points/sign-in', null, {
        params: { userId }
    })
}

// 获取当前用户积分记录
export const getPointsHistory = (params: PageRequest): Promise<PageResponse<PointsRecord>> => {
    return request.get('/api/points-service/api/points/history', { params })
}
